<!--  -->
<template>
  <div>
        <Card>
            <div slot="title" >
                <Button v-if='btnp.bxren_xzbxr' @click="handleClickowninfor" class="zh-hollow" type="primary" icon="plus-round">新增报修人</Button>
                <Button v-if="btnp.bxren_plxz" @click="modal_batch=true" style="marginLeft:25px;" class="zh-hollow" type="warning" >批量新增</Button>
            </div>
            <Form :model="formItem" :label-width="70">
                <Row :gutter="10" type="flex"  align="middle"  >
                    <Col span="8">
                        <FormItem label="人员">
                            <Input v-model="formItem.name" placeholder="姓名/手机号" clearable></Input>
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="员工号">
                            <Input v-model="formItem.notesid" placeholder="员工号" :maxlength="10" clearable></Input>
                        </FormItem>
                    </Col>
                    <Col span="8" v-if="user_type!='01'">
                        <FormItem label="所属客户" >
                            <Select v-model="formItem.customerUuid" filterable @on-change="searchCustomerChange">
                                <Option  v-for="item in moreCustomerList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                            </Select>
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="所在机构">
                            <Input v-if="user_type!='01'" @on-focus="s_tree=true;" :disabled="!formItem.customerUuid||formItem.customerUuid=='全部'" v-model="formItem.instName" placeholder="请选择机构" readonly></Input>
                            <Input v-else @on-focus="s_tree=true;"  v-model="formItem.instName" placeholder="请选择机构" readonly></Input>
                            <!-- <Select v-if="user_type!='01'" :disabled="!formItem.customerUuid||formItem.customerUuid=='全部'" v-model="formItem.inst_uuid" filterable>
                                <Option  v-for="item in moreMechanismList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                            </Select>
                            <Select v-else  v-model="formItem.inst_uuid" filterable>
                                <Option  v-for="item in moreMechanismList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                            </Select> -->
                        </FormItem>
                    </Col>
                <!-- </Row>
                <Row :gutter="10" type="flex" justify="space-between" align="middle"  > -->
                    <Col span="8">
                        <FormItem label="操作权限">
                            <Select v-model="formItem.auths" multiple>
                                <Option  v-for="item in morePowerList" :value="item.state" :key="item.state">{{ item.desc }}</Option>
                            </Select>
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="账号状态">
                            <Select v-model="formItem.state" >
                                <Option  v-for="item in stateList" :value="item.value" :key="item.value">{{ item.label }}</Option>
                            </Select>
                        </FormItem>
                    </Col>
                    <Col span="12"  >
                        <FormItem label="所在地">
                            <Cascader change-on-select v-model="search.location" placeholder="请选择省市区" :data="areasData" ></Cascader>
                        </FormItem>
                    </Col>
                    <Col span="12">
                        <FormItem label="新增时间">
                            <DatePicker v-model="search.timeRange" format="yyyy-MM-dd HH:mm" type="datetimerange" placement="bottom-end" placeholder="请选择开始和结束时间"></DatePicker>
                        </FormItem>
                    </Col>
                </Row>
                <Row :gutter="10" >
                <Col span="8" offset="16"  style="text-align:right;">
                    <Button class="zh-hollow" type="primary" icon="ios-search-strong" @click="handleClickgetTable">搜索</Button>
                    <!-- <Button v-if="btnp.bxren_dc" class="zh-hollow" type="warning" style="margin-left:25px;">导出EXCEL</Button> -->
                    <a v-if="btnp.bxren_dc" :href="downLoadUrl" target="_blank"><Button  class="zh-hollow" type="warning" style="margin-left:25px;" > 导出EXCEL </Button></a>
                </Col>
                
                </Row>
            </Form>
        </Card>
        <Card style="margin-top:10px;" :padding="0">
            <Table :loading="loading" border :columns="columns" :data="data"></Table>
            <Page :current.sync="formItem.pageNumber" :total="total" show-total show-sizer @on-change="pageChange" @on-page-size-change="pageSizeChange"></Page>
        </Card>
        <Modal v-model="modal_batch" title="批量导入机构"  class-name="vertical-center-modal">
            <div style="padding:15px 30px;">
                <p>从本地选择Excel格式的人员列表，批量导入人员。</p>
                <a :href="url_tempDc" target="_blank"><Button type="text" style="color:#2d8cf0" >下载Excel模板</Button></a>
            </div>
            <div slot="footer" class="zh-flex zh-flex-5" style="width:100%;">
                <Button @clcik="modal_batch=false;" type="ghost">放弃操作</Button>
                <Upload 
                ref="upload"
                :with-credentials="true"
                :on-success="handleSuccess"
                :on-progress="handleProgress"
                :format="['xlsx','xls']"
                :on-format-error="handleFormatError"
                :before-upload="handleBeforeUpload"
                :action="dr_url_bxr">
                    <Button type="primary" :loading="btnloading" class="zh-hollow">选择文件</Button>
                </Upload>
            </div>
        </Modal>
        <Modal v-model="modal_infor" :title="inforTitle" :loading="modal_loading" @on-ok="save" ok-text="保存" cancel-text="放弃操作" >
                <Form :model="owninfor" :label-width="80" style="padding:15px 30px;">
                    <FormItem label="姓名*">
                        <Input  v-model="owninfor.name" :maxlength="5"></Input>
                    </FormItem>
                    <FormItem label="员工号">
                        <Input  v-model="owninfor.notesid" :maxlength="10"  placeholder="4~10位的数字"></Input>
                    </FormItem>
                    <FormItem label="手机号*">
                        <Input  v-model="owninfor.mobile" :maxlength="11" number></Input>
                    </FormItem>
                    <FormItem label="所在地*">
                        <Cascader change-on-select v-model="owninfor.location" @on-change="repaireCascaderChange" placeholder="请选择省市区" :data="areasData" ></Cascader>
                    </FormItem>
                    <FormItem label="所属客户*" v-if="user_type!='01'">
                        <Select v-model="owninfor.customerUuid" :disabled="!owninfor.location[0]" @on-change="formCustomerChange">
                            <Option  v-for="item in customerList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                        </Select>
                    </FormItem>
                    <FormItem label="所在机构*">
                        <!-- <Select v-if="user_type!=='01'" :disabled="!owninfor.location[0]||(owninfor.customerUuid=='')" v-model="owninfor.instUuid" filterable  @on-change="instChange">
                            <Option  v-for="item in mechanismList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                        </Select>
                        <Select v-else :disabled="!owninfor.location[0]" v-model="owninfor.instUuid" filterable @on-change="instChange">
                            <Option  v-for="item in mechanismList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                        </Select> -->
                        <Input v-if="user_type!=='01'" @on-focus="f_tree=true;" :disabled="!owninfor.location[0]||(owninfor.customerUuid=='')" v-model="owninfor.instname" placeholder="请选择机构" readonly></Input>
					    <Input v-else @on-focus="f_tree=true;" :disabled="!owninfor.location[0]" v-model="owninfor.instname" placeholder="请选择机构" readonly></Input>
                    </FormItem>
                    <FormItem label="部门">
                        <Select v-model="owninfor.deptUuid" :disabled="owninfor.instUuid==''" >
                            <Option  v-for="item in partList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                        </Select>
                    </FormItem>
                    <FormItem label="操作权限">
                        <CheckboxGroup v-model="owninfor.power">
                            <Checkbox v-for="item in powerList" :key="item.state" :label="item.state" >{{item.desc}}</Checkbox>
                        </CheckboxGroup>
                    </FormItem>
                </Form>     
        </Modal>
        <Modal title="选择机构" v-model="s_tree" @on-ok="confirmST" :mask-closable="false" >
			<div style="padding:15px 30px;">
				<Tree :data="s_tree_data"   @on-select-change="s_selectChange"></Tree>
			</div>
		</Modal>
        <Modal title="选择机构" v-model="f_tree" :loading="ft_load" @on-ok="confirmF" :mask-closable="false" >
			<div style="padding:15px 30px;">
				<Tree :data="f_tree_data"   @on-select-change="f_selectChange"></Tree>
			</div>
		</Modal>
  </div>
</template>

<script>
import {url_bxrDc,url_tempDc,dr_url_bxr} from '@/libs/downLoadUrl'
import util from '@/libs/util.js'
import {
    getBankOrg,
    getCustomerListByLocation,
    getPower,
    getDeptList,
    getOrgTree
} from '@/libs/get.js';
import {
    getRepaireStaffTable,
    deleteReapireStaff,
    saveRepaireStaff
} from '@/libs/post.js';
export default {
    name:'',
    data () {
        return {
            ft_load:true,
			f_select_op:[],
			f_tree_data:[],
			f_tree:false,
            s_select_op:[],
			s_tree_data:[],
			s_tree:false,
            dr_url_bxr:dr_url_bxr,
            btnloading:false,
            url_tempDc:url_tempDc,
			downLoadUrl:url_bxrDc,
            btnp:{},
            btn:{
                bxren_xzbxr:false,
                bxren_plxz:false,
                bxren_dc:false,
                bxren_bj:false,
                bxren_sc:false
            },
            modal_loading:true,
            userUuid:'',
            user_type:'',
            modal_infor:false,
            inforTitle:'',
            owninfor:{
                uuid:'',
                name:'',
                notesid:'',
                mobile:'',
                location:[],
                customerUuid:'',
                instUuid:'',
                instname:'',
                deptUuid:'',
                power:[],
                province:'',
                city:'',
                district:'',
                
            },
            modal_batch:false,
            loading:true,
            total:0,
            search:{
                location:[],
                timeRange:[]
            },
            formItem:{
                name:'',
                notesid:'',
                customerUuid:'全部',
                inst_uuid:'全部',
                instName:'',
                auths:[],
                pageNumber:1,
                pageSize:10,
                province:'',
                city:'',
                district:'',
                state:'全部',
                startTime:'',
                endTime:'' 
            },
            stateList:[
                {
                    value:'全部',
                    label:'全部'
                },
                {
                    value:0,
                    label:'正常'
                },
                {
                    value:2,
                    label:'未激活'
                },
                {
                    value:4,
                    label:'已删除'
                }
            ],
            moreCustomerList:[],
            customerList:[],
            moreMechanismList:[{uuid:'全部',name:'全部'}],
            mechanismList:[], 
            areasData:this.$store.state.user.areaData,  
            partList :[]   ,        
            powerList:[]   ,
            morePowerList:[],
            columns:[
                {
                    key:'name',
                    title:'姓名',
                    fixed:'left',
                    minWidth:100
                },
                {
                    key:'mobile',
                    title:'手机号',
                    minWidth:150
                },
                {
                    key:'addr',
                    title:'所在地',
                    minWidth:180
                },
                {
                    key:'bank_name',
                    title:'所属客户',
                    minWidth:150
                },
                {
                    key:'inst_name',
                    title:'所在机构',
                    minWidth:120
                },
                {
                    key:'deptName',
                    title:'部门',
                    minWidth:120
                },
                {
                    key:'authName',
                    title:'操作权限',
                    minWidth:120
                },
                {
                    key:'notesid',
                    title:'员工号',
                    minWidth:120
                },
                {
                    key:'time',
                    title:'新增时间',
                    minWidth:150
                },
                {
                    key:'isdelete',
                    title:'账号状态',
                    minWidth:100
                },
                {
                    key:'action',
                    title:'操作',
                    align:'center',
                    fixed:'right',
                    minWidth:120,
                    render:(h,params)=>{
                        return h('div',[
                            h('Button',{
                                props:{
                                type:'text',
                                size:'small'
                                },
                                style:{
                                color:'#2D8CF0',
                                 display:this.btnp.bxren_bj?params.row.status!='4'?'inlin-block':'none':'none'
                                },
                                on:{
                                click:()=>{
                                    this.goEdit(params.row)
                                    
                                }
                                }
                            },'编辑'),
                            h('Button',{
                                props:{
                                type:'text',
                                size:'small'
                                },
                                style:{
                                color:'#EA0000',
                                display:this.btnp.bxren_sc?params.row.status!='4'?'inlin-block':'none':'none'
                                },
                                on:{
                                click:()=>{
                                    let config={
                                    title:'删除报修人',
                                    render:h=>{
                                        return h('div',{
                                            style:{
                                                padding:'30px 30px 0 30px',
                                                textAlign:'left'
                                            }
                                        },[
                                                h('p','删除报修人不会影响已产生的记录。'),
                                                h('p','删除报修人后，无法在列表中查找该报修人的信息。')
                                            ])
                                    },
                                    content:'删除报修人不会影响已产生的记录。删除报修人后，无法在列表中查找该报修人的信息。',
                                    okText:'删除',
                                    cancelText:'放弃操作',
                                    onOk:()=>{
                                        this.delete(params.row.uuid)
                                    }
                                    }
                                    this.$Modal.confirm(config)
                                }
                                }
                            },'删除')
                        ])
                    }
                }
            ]    ,
            data:[]  
        };
    },
    methods:{
         init(){
            let that=this;
            util.isCustomer(this);
            let timer;
			if(that.user_type!=='01'){
				timer=setInterval(()=>{
					if(that.$store.state.user.customer.length>0){
                        that.moreCustomerList=[{name:'全部',uuid:'全部'},...that.$store.state.user.customer];
                        this.customerList=that.$store.state.user.customer;
						clearInterval(timer)	
					}
				},500);
			}else{
				this.searchCustomerChange(this.userUuid);	
			}
        },
        async getFormInstTree(value,p,c,d){
			this.owninfor.instUuid='';
			this.owninfor.instname='';
			this.f_select_op=[];
			if(value!==''){
				let res=await getOrgTree(value,p,c,d);
				let response=res.data;
				if(response.code===200){
					this.f_tree_data=util.tree([response.data]);
				}else{
					this.$Notice.error({
						title: '获取机构失败',
						desc:response.msg
					});
				}
			}
		},
		f_selectChange(selectarr){
			this.f_select_op=selectarr;
		},
		async confirmF(){
			if(this.f_select_op.length>0){
				if(this.f_select_op[0].canChoose=='true'){
					this.owninfor.instUuid=this.f_select_op[0].value;
                    this.owninfor.instname=this.f_select_op[0].title;
                    await this.instChange(this.f_select_op[0].value);
				}else{
					this.$Notice.error({
						desc:'请选择有效节点'
					});
					this.ft_load=false;
					let that=this;
					setTimeout(() => {
						that.ft_load=true;
					}, 200);
					return false
				}
				
			}else{
				this.owninfor.instUuid='';
				this.owninfor.instname='';
			}
			this.f_tree=false;
		},
        async getSearchInstTree(value){
            this.formItem.inst_uuid='';
            this.formItem.instName='';
            this.s_select_op=[];
			if(value!=='全部'){
				let res=await getOrgTree(value);
				let response=res.data;
				if(response.code===200){
					this.s_tree_data=util.tree([response.data]);
				}else{
					this.$Notice.error({
						title: '获取机构失败',
						desc:response.msg
					});
				}
			}
		},
		s_selectChange(selectarr){
			this.s_select_op=selectarr;
		},
		confirmST(){
			if(this.s_select_op.length>0){
				this.formItem.inst_uuid=this.s_select_op[0].value;
				this.formItem.instName=this.s_select_op[0].title;
			}else{
				this.formItem.inst_uuid='';
				this.formItem.instName='';
			}
		},
        handleSuccess(res, file){
            if(res.code==200){
                this.$Notice.success({
                    desc:res.msg
                });
                this.modal_batch=false;
                this.getTable();
            }else{
                this.$Notice.error({
                    desc:res.msg
                })
            }
            this.btnloading=false;
        },
        handleProgress(){
            this.btnloading=true;
        },
        handleBeforeUpload(){

        },
        handleFormatError (file) {
            this.$Notice.warning({
                title: '文件格式错误',
                desc: '请选择 xlsx 或 xls 格式的文件'
            });
        },
        async save(){
            const reg=this.$store.state.app.mobileReg;
            const nameReg=/^[\u4e00-\u9fa5]{2,5}$/;
            const notesidReg=/^\d{4,10}$/;
            if(!this.owninfor.name||!nameReg.test(this.owninfor.name)){
                this.$Notice.error({
                    desc:'请输入真实姓名'
                })
            }else if(this.owninfor.notesid.length>0&&!notesidReg.test(this.owninfor.notesid)){
                this.$Notice.error({
                    desc:'员工号格式错误'
                })
            }
            else if(!this.owninfor.mobile){
                this.$Notice.error({
                    desc:'请输入手机号'
                })
            }
            else if(!reg.test(this.owninfor.mobile)){
                this.$Notice.error({
                    desc:'手机号格式错误'
                })
            }else if(!this.owninfor.location[0]){
                this.$Notice.error({
                    desc:'请选择所在地'
                })
            }else if(this.user_type!='01'&&this.owninfor.customerUuid.length<=0){
                this.$Notice.error({
                    desc:'请选择所属客户'
                })
            }else if(this.owninfor.instUuid.length<=0){
                this.$Notice.error({
                    desc:'请选择所在机构'
                })
            }else{
                
                let form=JSON.parse(JSON.stringify(this.owninfor));
                form.auth_uuid=form.power.join(',');
                let text;
                if(this.inforTitle=='新增人员'){
                    form.flag='save';
                    text='新增成功，已发送激活短信';
                }else{
                    form.flag='edit';
                    text='编辑成功';
                }
                let res=await saveRepaireStaff(form);
                let response=res.data;
               
                if(response.code===200){
                    this.$Notice.success({
                        desc:text
                    });
                    this.modal_infor=false;
                    this.formItem.pageNumber=1;
                    this.getTable();
                }else{
                    this.$Notice.error({
                    title: '请求出错',
                    desc:response.msg
                    });
                }
            }
            this.modal_loading=false;
            let that=this;
            setTimeout(()=>{
                that.modal_loading=true;
            },500)
            
        },
        async delete(uuid){
            let res=await deleteReapireStaff(uuid);
            let response=res.data;
            if(response.code===200){
                this.$Notice.success({
                    desc:'删除成功'
                })
                this.getTable();
            }else{
                this.$Notice.error({
                title: '请求出错',
                desc:response.msg
                });
            }
        },
        handleClickgetTable(){
            this.formItem.pageNumber=1;
            this.getTable();
        },
        async goEdit(obj){
            this.modal_infor=true;
            this.inforTitle="编辑人员信息";
            let arr=obj.addr.split(' ');
            this.owninfor={
                uuid:obj.uuid,
                notesid:obj.notesid,
                name:obj.name,
                mobile:obj.mobile,
                location:arr,
                customerUuid:obj.bank_uuid,
                instUuid:obj.inst_uuid,
                instname:obj.inst_name,
                deptUuid:obj.deptUuid,
                power:!!obj.auth_uuid?obj.auth_uuid.split(','):[],
                province:arr[0],
                city:arr[1],
                district:arr[2]   
            }
            if(this.owninfor.customerUuid.length>0){
                let res= await getCustomerListByLocation(arr[0],arr[1],arr[2]);
                let response=res.data;
                if(response.code===200){
                    this.customerList=response.data;
                    
                }else{
                    this.$Notice.error({
                        title: '请求出错',
                        desc:response.msg
                    });
                }
            }
            if(this.owninfor.instUuid.length>0){
                await this.getFormInstTree(this.owninfor.customerUuid,this.owninfor.province,this.owninfor.city,this.owninfor.district);
                //await this.newSearchCustomerChange(this.owninfor.customerUuid,'form');
                this.f_tree_data=util.TreeFormat2(this.f_tree_data,obj.inst_uuid);
                this.owninfor.instUuid=obj.inst_uuid;
                this.owninfor.instname=obj.inst_name;
            }
            if(this.owninfor.deptUuid.length>0){
                await this.instChange(this.owninfor.instUuid);
                this.owninfor.deptUuid=obj.deptUuid;
            }
        },
        handleClickowninfor(){
            this.modal_infor=true;
            this.inforTitle="新增人员";
        },
        async getTable(){
            
            this.loading=true;
            let form=JSON.parse(JSON.stringify(this.formItem));
            for(let key in form){
                if(form[key]==='全部'){
                form[key]='';
                }
            }
           form.auth=form.auths.join(',');
            if(!!this.search.timeRange[0]&&this.search.timeRange.length>0){
                form.startTime=util.time1(this.search.timeRange[0]);
                form.endTime=util.time1(this.search.timeRange[1]);
            }
            
            if(this.search.location.length>0&&!!this.search.location[0]){
                form.province=this.search.location[0];
                form.city=this.search.location[1];
                form.district=this.search.location[2];
            }
            
            let res=await getRepaireStaffTable(form);
            let response=res.data;
            if(response.code===200){
                this.total=response.data.total;
                this.data=response.data.rows.map(item=>{
                    item.time=item.created.slice(0,16);
                    return item
                });
                this.loading=false;
                this.downLoadUrl=`${url_bxrDc}${util.pjArgu(form)}`
            }else{
                this.$Notice.error({
                title: '失败',
                desc:response.msg
                });
               
            }
        },
        pageSizeChange(size){
            //回到第一页
            this.formItem.pageNumber=1;
            this.formItem.pageSize=size;
            this.getTable();
        },
        pageChange(number){
            this.formItem.pageNumber=number;
            this.getTable();
        },
        async actionPower(){
            let res=await getPower();
            let response=res.data;
            if(response.code===200){
                this.powerList=response.data;
                this.morePowerList=[{state:'wu',desc:'无'},...response.data];
            }else{
                this.$Notice.error({
                title: '请求出错',
                desc:response.msg
                });
            }
        },
        async instChange(value){
            //选择机构后
            if(this.modal_infor){
                this.deptUuid='';
            let res=await getDeptList(value);
            let response=res.data;
            if(response.code===200){
                this.partList=response.data
            }else{
                this.$Notice.error({
                title: '请求出错',
                desc:response.msg
                });
            }
            }
            
        },
        // async newSearchCustomerChange(value,type){
        //     if(value!=='全部'){
        //     let res;
        //     if(type=='search'){
        //         res =await getBankOrg(value,'','','')
        //     }else{
        //         res =await getBankOrg(value,this.owninfor.province,this.owninfor.city,this.owninfor.district)
        //     }
        //     if(res.status===200){
        //         let response=res.data;
        //         if(response.code===200){
        //             if(type==='search'){
        //                 this.moreMechanismList=[{uuid:'全部',name:'全部'},...response.data]
        //             }else if(type==='form'){
        //                 this.mechanismList=response.data
        //             }
        //         }else{
        //             this.$Notice.error({
        //                 title: '请求出错',
        //                 desc:response.msg
        //             });
        //         }
        //     }else{
        //         this.$Notice.error({
        //             title: '请求失败'
        //         });
        //     } 
        //     }
        // },
        async formCustomerChange(value){
            if(this.modal_infor){
                //await this.newSearchCustomerChange(value,'form');
                await this.getFormInstTree(value,this.owninfor.province,this.owninfor.city,this.owninfor.district);
                this.owninfor.instUuid='';
                this.owninfor.deptUuid='';
            }
            
        },
        async searchCustomerChange(value){
            this.getSearchInstTree(value);
           // await this.newSearchCustomerChange(value,'search')
        },
        async repaireCascaderChange(value,selectedData){
            if(!!value){
                this.owninfor.province=value[0];
                this.owninfor.city=value[1];
                this.owninfor.district=value[2];
                //更新客户列表，如果客户已选则清空
                if(this.user_type!=='01'){
                    let res= await getCustomerListByLocation(value[0],value[1],'');
                    let response=res.data;
                    if(response.code===200){
                        this.customerList=response.data;
                        
                    }else{
                        this.$Notice.error({
                            title: '请求出错',
                            desc:response.msg
                        });
                    }
                }else{
                    //this.newSearchCustomerChange(this.userUuid,'form')
                    this.getFormInstTree(this.userUuid,value[0],value[1],value[2]);
                }
            }else{
                this.owninfor.province='';
                this.owninfor.city='';
                this.owninfor.district='';
                this.customerList=[];
            }
            this.owninfor.customerUuid='';
            this.owninfor.instUuid='';
            this.owninfor.deptUuid='';
        },
        // async newSearchCustomerChange(value,type){
        //     if(value!=='全部'){
        //         let res;
        //         if(type=='search'){
        //             res =await getBankOrg(value,'','','')
        //         }else{
        //             res =await getBankOrg(value,this.owninfor.province,this.owninfor.city,this.owninfor.district)
        //         }
        //         if(res.status===200){
        //             let response=res.data;
        //             if(response.code===200){
        //                 if(type==='search'){
        //                 this.moreMechanismList=[{uuid:'全部',name:'全部'},...response.data]
        //                 }else if(type==='form'){
        //                 this.mechanismList=response.data
        //                 }
        //             }else{
        //                 this.$Notice.error({
        //                     title: '请求出错',
        //                     desc:response.msg
        //                 });
        //             }
        //         }else{
        //             this.$Notice.error({
        //                 title: '请求失败'
        //             });
        //         } 
        //     }else{
        //         this.formItem.inst_uuid=''
        //     }
        // },
    },
    created(){
        this.init();
        this.actionPower();
        this.getTable();
        this.btnp=util.bpower(this,this.btn);
    },
    watch:{
        modal_infor:function(){
            if(!this.modal_infor){
                this.customerList=[];
                this.mechanismList=[];
                this.partList=[];
                this.owninfor={
                    uuid:'',
                    notesid:'',
                    name:'',
                    mobile:'',
                    location:[],
                    customerUuid:'',
                    instUuid:'',
                    deptUuid:'',
                    power:[],
                    province:'',
                    city:'',
                    district:'',
                    
                }
            }
        }
    }

}

</script>
<style lang='scss' >
.ivu-upload-list{
    display:none!important;
}
</style>